Crate koto_memory

source ·
Expand description

Memory management utilities for Koto

Currently, only reference-counted pointers without cycle detection are implemented. The intent is that this crate can be expanded in the future with implementations of Ptr and PtrMut that offer alternative memory management strategies.

Making custom GC types that support trait objects or other DSTs is currently only possible with nightly Rust, while the stabilization of DST custom coercions is pending 1. Until then, GC implementations for Ptr/PtrMut could be introduced with a nightly-only feature.

1 https://github.com/rust-lang/rust/issues/18598


  1.  

Macros§

  • Makes a Ptr, with support for casting to trait objects
  • Makes a PtrMut, with support for casting to trait objects

Structs§

  • A wrapper for comparing and hashing pointer addresses
  • An immutably borrowed reference to a value borrowed from a KCell
  • A mutably borrowed reference to a value borrowed from a KCell
  • A mutable value with borrowing checked at runtime
  • An immutable pointer to a value in allocated memory

Type Aliases§

  • A mutable pointer to a value in allocated memory